package com.qyt.hotel.service.impl;

import com.qyt.hotel.dao.AdminMapper;
import com.qyt.hotel.entity.User;
import com.qyt.hotel.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {

    @Resource
    private AdminMapper adminMapper;

    @Override
    public List<User> getAdminList(Integer roleId) {
        return adminMapper.getAdminList(roleId);
    }

    @Override
    public Integer addAdmin(User user) {
        return adminMapper.addAdmin(user);
    }

    @Override
    public User getOne(User user) {
        return adminMapper.getOne(user);
    }

    @Override
    public Integer deleteAdmin(User user) {
        return adminMapper.deleteAdmin(user);
    }

    @Override
    public Integer updateAdmin(User user) {
        return adminMapper.updateAdmin(user);
    }

    @Override
    public String getPassWord(Integer id) {
        return adminMapper.getPassWord(id);
    }

    @Override
    public Integer resetPass(Integer id, String newPass) {
        return adminMapper.resetPass(id, newPass);
    }
}
